package users.dawn.processor;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

@SuppressWarnings("javadoc")
public class CustomBeanPostProcessor implements BeanPostProcessor {
	
	// simply return the instantiated bean as-is
	@Override
	public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
		return bean; // we could potentially return any object reference here...
	}

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		System.out.println("*** CustomBeanPostProcessor for Bean '" + beanName + "':\n" 
							+ bean.toString()
							+ "\n*** CustomBeanPostProcessor Done!" );
		
		return bean;
	}
}
